#!/usr/bin/env ruby
fetcher_command = `ps -A -f | grep "ruby ./script/fetcher" | grep -v grep`
if fetcher_command != ''
  pid = fetcher_command.split(/\s+/)[1]
  puts "find pid #{pid}"
  puts "try to kill it"
  `kill #{pid}`
  if $?.success?
    puts "process killed"
  else
    puts "can not kill process"
  end
else
  puts "pid not found, is it running?"
end
